package user

import (
	"context"

	"gitee.com/liuxuezhan/ar-platform/rpc-client/userServiceClient/userrpc"

	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/svc"
	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type UpdateUserRemarkLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

// 会员管理 - 会员管理 - 会员详情操作: 更新会员备注
func NewUpdateUserRemarkLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateUserRemarkLogic {
	return &UpdateUserRemarkLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *UpdateUserRemarkLogic) UpdateUserRemark(req *types.UpdateUserRemarkRequest) (resp *types.UpdateUserRemarkResponse, err error) {
	_, err = l.svcCtx.UserServiceRPC.UserModifyRemark(l.ctx, &userrpc.UserModifyRemarkRequest{
		UserId: req.UserID,
		Remark: req.Remark,
	})

	return
}
